//引入封装好的request
import request from "@/utils/request";
//引入定义好的数据类型
import type {
  LoginForm,
  LoginResponseData,
  UserInfoResponseData,
} from "./type";
//统一管理接口
enum Api {
  LOGIN_API = "/admin/acl/index/login",
  USER_INFO = "/admin/acl/index/info",
  LOGOUT_API = "/admin/acl/index/logout",
}
//用户登录接口
export const resLogin = (data: LoginForm) =>
  request.post<any, LoginResponseData>(Api.LOGIN_API, data);
//获取用户信息接口
export const resUserInfo = () =>
  request.get<any, UserInfoResponseData>(Api.USER_INFO);
//用户退出登录接口
export const resLogout = () => request.post<any, any>(Api.LOGOUT_API);
